package com.b2bpsssm.controller.capital;

import com.b2bpsssm.common.R;
import com.b2bpsssm.service.RunningWaterService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Api(value = "资金流水数据测试",tags = "资金流水API")
public class RunningWaterController {
    @Autowired
    private RunningWaterService runningWaterService;

    // 查询收款单信息 有分页
    @RequestMapping(value = "/runningWater/queryRunningWaterList",method = {RequestMethod.GET},produces = "application/json;charset=utf-8")
    @ApiOperation(value = "资金流水",notes = "资金流水查询",httpMethod = "get")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "当前页码数", required = true),

            @ApiImplicitParam(name = "limit", value = "每页条数", required = true),
    })
    @ResponseBody
    public R queryRunningWaterList(Integer page, Integer limit){
        // 调用Service层进行业务逻辑处理
        return runningWaterService.queryRunningWaterList(page,limit);
    }




    //根据单据标号查询详情
    @RequestMapping(value = "/runningWater/queryRunningWaterByNumber", method = {RequestMethod.GET}, produces = "application/json;charset=utf-8")
    @ApiOperation(value = "资金流水",notes = "根据单据标号查询详情",httpMethod = "get",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "running_water_number", value = "单据编号", required = true),
 })
    @ResponseBody
    public R queryRunningWaterByNumber(String running_water_number){
        // 调用Service层进行业务逻辑处理
        return runningWaterService.queryRunningWaterByNumber(running_water_number);

    }

    //    以编号关键字 时间范围 进行关键字查询
    @RequestMapping(value = "/runningWater/selRunningWaterLikeNumber",method = RequestMethod.GET)
    @ApiOperation(value = "资金流水",notes = "以编号关键字 时间范围 进行关键字查询",httpMethod = "get",response = R.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = " page", value = "当前页码数", required = true),
            @ApiImplicitParam(name = "limit", value = "每页点数", required = true),
            @ApiImplicitParam(name = "running_water_trading_hour1", value = "开始时间", required = true),
            @ApiImplicitParam(name = "running_water_trading_hour2", value = "结束时间", required = true),
            @ApiImplicitParam(name = "running_water_no", value = "单据编号", required = true),
    })
    @ResponseBody
    public R selRunningWaterLikeNumber(Integer page, Integer limit, String running_water_trading_hour1, String running_water_trading_hour2 , String running_water_no) {
        return   runningWaterService.selRunningWaterLikeNumber(page,limit,running_water_trading_hour1,running_water_trading_hour2,running_water_no);

    }

}
